parse_git_branch() {
    (git branch || arc branch) 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /'
}

export EDITOR=vim
export VISUAL="vim"
export GIT_EDITOR="vim"
export PATH="$HOME/vcpkg:$HOME/.cargo/bin:$HOME/go/bin:$HOME/bin:$PATH"
export VCPKG_ROOT=$HOME/vcpkg
export PS1="\[\e[01;33m\]\w\[\e[00m\e[1;32m\] \$(parse_git_branch)\[\e[0;36m\]\$\[\e[0m\] "

shopt -s checkwinsize
set -o vi

bind -m vi-insert "\C-l":clear-screen
bind -m vi-insert "\C-p":previous-history
bind -m vi-insert "\C-n":next-history
bind -m vi-insert "\C-a":beginning-of-line
bind -m vi-insert "\C-e":end-of-line
bind -m vi-insert "\C-f":forward-char
bind -m vi-insert "\C-b":backward-char

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
[ -f "/usr/local/etc/bash_completion" ] && . "/usr/local/etc/bash_completion"
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
[ -f /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)"
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"
